<template>
  <div style="margin: 40px">
    <h1>评论列表1</h1>
    <ParentComment :comments="comments" />
  </div>
</template>
<script setup>
import { ref } from 'vue'
import ParentComment from './commponents/ParentComment.vue'

// 评论数据
const comments = ref([
  {
    commentId: 1,
    parentId: 0,
    userName: '蜻蜓队长',
    newsId: null,
    commentContent: '这是一个评论',
    commentTime: '2023-12-08 17:14:05',
    children: [
      {
        commentId: 5,
        parentId: 1,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '这是一个评论',
        commentTime: '2023-12-08 17:25:12',
        children: [
          {
            commentId: 15,
            parentId: 5,
            userName: 'Roc9',
            newsId: null,
            commentContent: '回复5的话',
            commentTime: '2023-12-08 19:04:01',
            children: [
              {
                commentId: 16,
                parentId: 15,
                userName: 'Roc9',
                newsId: null,
                commentContent: '回复15的话',
                commentTime: '2023-12-08 19:04:12',
                children: [
                  {
                    commentId: 17,
                    parentId: 16,
                    userName: 'Roc9',
                    newsId: null,
                    commentContent: '子评论的子评论的子评论的子评论',
                    commentTime: '2023-12-08 19:05:03',
                    children: null
                  }
                ]
              },
              {
                commentId: 18,
                parentId: 15,
                userName: 'Roc9',
                newsId: null,
                commentContent: '挺好的',
                commentTime: '2023-12-08 19:05:28',
                children: null
              },
              {
                commentId: 19,
                parentId: 15,
                userName: 'Roc9',
                newsId: null,
                commentContent: '这是新闻2的评论',
                commentTime: '2023-12-08 19:15:49',
                children: null
              }
            ]
          }
        ]
      },
      {
        commentId: 6,
        parentId: 1,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '这是一个评论',
        commentTime: '2023-12-08 17:25:26',
        children: null
      },
      {
        commentId: 7,
        parentId: 1,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '这是一个评论',
        commentTime: '2023-12-08 17:35:44',
        children: null
      },
      {
        commentId: 8,
        parentId: 1,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '这是一个评论',
        commentTime: '2023-12-08 18:29:17',
        children: null
      },
      {
        commentId: 9,
        parentId: 1,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '我是神，天地以我为尊',
        commentTime: '2023-12-08 18:32:18',
        children: null
      },
      {
        commentId: 10,
        parentId: 1,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '我是神，天地以我为尊',
        commentTime: '2023-12-08 18:42:49',
        children: [
          {
            commentId: 14,
            parentId: 10,
            userName: 'Roc9',
            newsId: null,
            commentContent: '天地之大，无奇不有',
            commentTime: '2023-12-08 18:59:04',
            children: null
          }
        ]
      }
    ]
  },
  {
    commentId: 2,
    parentId: 0,
    userName: '蜻蜓队长',
    newsId: null,
    commentContent: '这是一个评论',
    commentTime: '2023-12-08 17:15:04',
    children: [
      {
        commentId: 11,
        parentId: 2,
        userName: '蜻蜓队长',
        newsId: null,
        commentContent: '我是神，天地以我为尊',
        commentTime: '2023-12-08 18:43:22',
        children: null
      }
    ]
  },
  {
    commentId: 3,
    parentId: 0,
    userName: '蜻蜓队长',
    newsId: null,
    commentContent: '这是一个评论',
    commentTime: '2023-12-08 17:21:36',
    children: [
      {
        commentId: 12,
        parentId: 3,
        userName: 'Roc9',
        newsId: null,
        commentContent: '天地之大，无奇不有',
        commentTime: '2023-12-08 18:49:10',
        children: null
      }
    ]
  },
  {
    commentId: 4,
    parentId: 0,
    userName: '蜻蜓队长',
    newsId: null,
    commentContent: '这是一个评论',
    commentTime: '2023-12-08 17:23:15',
    children: null
  },
  {
    commentId: 13,
    parentId: 0,
    userName: 'Roc9',
    newsId: null,
    commentContent: '天地之大，无奇不有',
    commentTime: '2023-12-08 18:49:37',
    children: null
  }
])
</script>

<style scoped></style>
